package com.framework.common.util.match;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.common.util.match
 * @description 匹配变量工具类
 * @datetime 2020-01-09 11:11:11
 */
public class MatchConstantUtil {
    /**
     * 银行-定时任务规则
     */
    public static final String REGEX_TIMETASK = "^((((([1-9]{1}\\d*)|([0]{1}))(\\.(\\d{1,2})))|(\\d*))((,(((([1-9]{1}\\d*)|([0]{1}))(\\.(\\d{1,2})))|(\\d*)))*))$";
    /**
     * 商户-费率进行校验
     */
    public static final String REGEX_FEERATE = "^([0-1])(\\.(\\d){0,5})?$";
    /**
     * 商户-费率进行校验
     */
    public static final String REGEX_WHITELIST_IP = "^((25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)((,(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d))*))$";
    /**
     * 校验密码
     */
    public static final String PASSWORD = "^(?![A-Za-z]+$)(?![A-Z\\d]+$)(?![A-Z\\W]+$)(?![a-z\\d]+$)(?![a-z\\W]+$)(?![\\d\\W]+$)\\S{6,25}$";
    /**
     * 手机号码效验
     */
    public static final String REGEX_PHONE = "^((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))$";
    /**
     * 手机号码校验2
     */
    public static final String REGEX_PHONE2 = "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|16[0|1|2|3|5|6|7|8|9]|17[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9]|19[0|1|2|3|5|6|7|8|9])\\d{8}$";

    //    public static final String REGEX_PHONE = "^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$";
    /**
     * IP验证
     */
    public static final String REGEX_IP = "^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$";
    /**
     * 邮箱效验
     */
    public static final String REGEX_EMAIL = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$";
    /**
     * 年月效验
     */
//    public static final String REGEX_YYYY_MM = "^([1-9]\\d{3}-)(([0]{0,1}[1-9])|([1][0-2]))*$";
    public static final String REGEX_YYYY_MM = "^([1-9]\\d{3}-)(([0]{0,1}[1-9])|([1][0-2]))$";
    /**
     * 验证字母数字
     */
    public static final String REGEX_EN = "^[a-zA-Z0-9]+$";
    /**
     * 验证字母
     */
    public static final String REGEX_ENGLISH = "^[a-zA-Z]+$";
    /**
     * 验证数字
     */
    public static final String REGEX_NUMBER = "^[0-9]+$";
    /**
     * 判断是否为纯中文，不是返回false
     */
    public static final String REGEX_REGE = "^[\\u4e00-\\u9fa5]+$";
    /**
     * 判断是否为url
     */
    public static final String REGEX_URL = "^(http(s)?:\\/\\/){1}(www\\.)?([0-9a-z-]{1,}.)?[0-9a-z-]{2,}.([0-9a-z-]{2,}.)?[a-z]{2,}(\\/)?$";
    /**
     * 判断是否为域名后缀URL
     */
    public static final String REGEX_URL_SUFFIX = "^(\\/{1}[a-z]+)+$";


    /**
     * 替换手机号码中间4位正则
     */
    public static final String HIDE_PHONE_KEY = "(\\d{3})\\d{4}(\\d{4})";
    /**
     * 替换手机号码中间4位值
     */
    public static final String HIDE_PHONE_VALUE = "$1****$3";

    /**
     * 替换手机号码中间6位正则
     */
    public static final String HIDE_PHONE_KEY_TWO = "(\\w{3})(\\w{6})(\\w{2})";
    /**
     * 替换手机号码中间6位值
     */
    public static final String HIDE_PHONE_VALUE_TWO = "$1******$3";

    /**
     * 替换手机号码中间6位正则
     */
    public static final String HIDE_MAIL_KEY = "(^\\w)[^@]*(@.*$)";
    /**
     * 替换手机号码中间6位值
     */
    public static final String HIDE_MAIL_VALUE = "$1****$2";

    /**
     * 验证公司名字 由中文字符、英文字母、数字、中划线、下划线、点、空格和中英文圆括号组成,且不能仅输入空格
     */
    public static final String REGEX_ENTERPRISENAME = "^(?!\\s*$)[A-Za-z0-9._\\-\\(\\)\\u4e00-\\u9fa5\\（）\\s-－·]+$";

    /**
     * 企业税号校验 15位 18位或者20位数字字母
     */
    public static final String REGEX_ENTERPRISE_TAX = "^[A-Z0-9]{15}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$";

    /**
     * 身份证校验
     */
    public static final String ID_CARD = "^[1-9]\\d{5}(19|20)\\d{2}(0\\d|1[0-2])([0-2]\\d|3[0-1])\\d{3}([0-9]|X)$";

    /**
     * 身份证校验包含15位、18位
     */
    public static final String ID_CARD2 = "(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";

    /**
     * 判断url是否合规 url无追加   例如：www.baidu.com
     */
    public static final String REGEX_URL_NONE_ADDITION = "^(http|ftp|https):\\/\\/[\\w]+(\\.[\\w\\u4e00-\\u9fa5+@#/%?=~_|!:,.;]+)+([.com]|[.cn])(\\/?)$";

    /**
     * 判断url是否合规 url有追加路径   例如：www.baidu.com/app/music
     */
    public static final String REGEX_URL_WITH_PATH = "^(http|ftp|https):\\/\\/[\\w]+(\\.[\\w\\u4e00-\\u9fa5\\-+@#/%?=~_|!:,.;]+)+([.com]|[.cn])(\\/[\\w-+@#/%?=~_|!:,.;]+)+(\\/?)$";

    /**
     * 判断url是否合规 url有追加路径且只有请求参数只有一个   例如：www.baidu.com/app/music?param=1
     */
    public static final String REGEX_URL_WITH_PATH_ONE_PARAM = "^(http|ftp|https):\\/\\/[\\w]+(\\.[\\w\\u4e00-\\u9fa5\\-+@#/%?=~_|!:,.;]+)+([.com]|[.cn])(\\/[\\w-+@#/%?=~_|!:,.;]+)+[\\?]{1,1}([\\w]+=([\\w\\u4e00-\\u9fa5+@#/%?=~_|!:,.;/\\s]+))(\\/?)$";

    /**
     * 判断url是否合规 url有追加路径且有多个请求参数  例如：www.baidu.com/app/music?param1=1&param2=2&param3=3
     */
    public static final String REGEX_URL_WITH_PATH_MANY_PARAM = "^(http|ftp|https):\\/\\/[\\w]+(\\.[\\w\\u4e00-\\u9fa5\\-+@#/%?=~_|!:,.;]+)+([.com]|[.cn])(\\/[\\w-+@#/%?=~_|!:,.;]+)+[\\?]{1,1}([\\w]+=([\\w\\u4e00-\\u9fa5+@#/%?=~_|!:,.;]+))([\\&]{1,1}[\\w]+=([\\w\\u4e00-\\u9fa5+@#/%?=~_|!:,.; ]+))+(\\/?)$";

}
